home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 1 Issue 2 / PDCD-1 - Issue 02.iso / _utilities / utilities / 003 / _gs / !GS / h / GXIMAGE < prev    next >
Text File  |  1991-10-25  |  3KB  |  69 lines

  1. /* Copyright (C) 1989, 1990 Aladdin Enterprises.  All rights reserved.
  2.    Distributed by Free Software Foundation, Inc.
  3.  
  4. This file is part of Ghostscript.
  5.  
  6. Ghostscript is distributed in the hope that it will be useful, but
  7. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  8. to anyone for the consequences of using it or for whether it serves any
  9. particular purpose or works at all, unless he says so in writing.  Refer
  10. to the Ghostscript General Public License for full details.
  11.  
  12. Everyone is granted permission to copy, modify and redistribute
  13. Ghostscript, but only under the conditions described in the Ghostscript
  14. General Public License.  A copy of this license is supposed to have been
  15. given to you along with Ghostscript so you can know your rights and
  16. responsibilities.  It should be in a file named COPYING.  Among other
  17. things, the copyright notice and this notice must be preserved on all
  18. copies.  */
  19.  
  20. /* gximage.h */
  21. /* Internal definitions for image rendering */
  22. /* Requires gzcolor.h */
  23.  
  24. /* Imaging state structure */
  25. /* The Unix C compiler can't handle typedefs for procedure */
  26. /* (as opposed to pointer-to-procedure) types, */
  27. /* so we have to do it with a macro instead: */
  28. #define iunpack_proc_args\
  29.     P4(gs_image_enum *, byte *, byte *, uint)
  30. #define irender_proc_args\
  31.     P4(gs_image_enum *, byte *, uint, int)
  32. struct gs_image_enum_s {
  33.     /* Following are set at structure initialization */
  34.     int width;
  35.     int height;
  36.     int log2_bps;            /* log2(bits per sample), [0..3] */
  37.     int spp;            /* samples per pixel, 1, 3, or 4 */
  38.     int spread;            /* spp if colors are separated, */
  39.                     /* 1 otherwise */
  40.     fixed fxx, fxy, fyx, fyy;    /* fixed version of matrix */
  41.     void (*unpack)(iunpack_proc_args);
  42.     int (*render)(irender_proc_args);
  43.     gs_state *pgs;
  44.     byte *buffer;            /* for expanding to 8 bits/sample */
  45.     uint buffer_size;
  46.     uint bytes_per_row;        /* # of input bytes per row */
  47.                     /* (per plane, if spp == 1 and */
  48.                     /* spread > 1) */
  49.     int never_clip;            /* true if entire image fits */
  50.     int skewed;            /* true if image is skewed */
  51.                     /* or rotated */
  52.     int slow_loop;            /* true if !never_clip, skewed, */
  53.                     /* or imagemask with a halftone */
  54.     fixed adjust;            /* adjustment when rendering */
  55.                     /* characters */
  56.     /* Following are updated dynamically */
  57.     byte *planes[4];        /* separated color data */
  58.     int plane_index;        /* current plane index, [0..spp) */
  59.     uint plane_size;        /* size of data in each plane */
  60.     uint byte_in_row;        /* current input byte position in row */
  61.     fixed xcur, ycur;        /* device x, y of current row */
  62.     int y;
  63.     /* Entries 0 and 255 of the following are set at initialization, */
  64.     /* other entries are updated dynamically */
  65.     gx_device_color dev_colors[256];
  66. #define icolor0 dev_colors[0].color1
  67. #define icolor1 dev_colors[255].color1
  68. };
  69.